package models

import (
	"time"

	"cdk.tf/go/stack/interfaces"
	// "your-project/interfaces"
)

type EC2InstanceMetadata struct {
	Config       *interfaces.EC2Config
	CreatedAt    time.Time
	ResourceName string
	Region       string
	DeploymentID string
}

type EC2InstanceResponse struct {
	InstanceID       string            `json:"instance_id"`
	PublicIP         string            `json:"public_ip"`
	PrivateIP        string            `json:"private_ip"`
	State            string            `json:"state"`
	InstanceType     string            `json:"instance_type"`
	SubnetID         string            `json:"subnet_id"`
	VPCID            string            `json:"vpc_id"`
	SecurityGroups   []string          `json:"security_groups"`
	Tags             map[string]string `json:"tags"`
	LaunchTime       time.Time         `json:"launch_time"`
	AvailabilityZone string            `json:"availability_zone"`
}

type EC2InstanceMetrics struct {
	InstanceID     string    `json:"instance_id"`
	CPUUtilization float64   `json:"cpu_utilization"`
	NetworkIn      float64   `json:"network_in"`
	NetworkOut     float64   `json:"network_out"`
	DiskReadOps    float64   `json:"disk_read_ops"`
	DiskWriteOps   float64   `json:"disk_write_ops"`
	Timestamp      time.Time `json:"timestamp"`
}

type EC2CreationRequest struct {
	Name              string            `json:"name"`
	AmiID             string            `json:"ami_id"`
	InstanceType      string            `json:"instance_type"`
	KeyName           string            `json:"key_name"`
	SubnetID          string            `json:"subnet_id"`
	SecurityGroupIDs  []string          `json:"security_group_ids"`
	UserData          string            `json:"user_data"`
	Tags              map[string]string `json:"tags"`
	AssociatePublicIP bool              `json:"associate_public_ip"`
	Region            string            `json:"region"`
	Count             int               `json:"count"`
}

type EC2QueryRequest struct {
	InstanceIDs     []string          `json:"instance_ids"`
	SubnetID        string            `json:"subnet_id"`
	VPCID           string            `json:"vpc_id"`
	SecurityGroupID string            `json:"security_group_id"`
	Tags            map[string]string `json:"tags"`
	InstanceType    string            `json:"instance_type"`
	State           string            `json:"state"`
	Region          string            `json:"region"`
}

type EC2OperationResponse struct {
	Success    bool     `json:"success"`
	Message    string   `json:"message"`
	InstanceID string   `json:"instance_id,omitempty"`
	Details    []string `json:"details,omitempty"`
}
